<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:p="http://primefaces.org/ui"
                template="../templates/ui.xhtml">

    <ui:define name="content">

        <h1 class="title ui-widget-header ui-corner-all">Pie Chart</h1>
        <div class="entry">
            <p>PieChart is created with a PieChartModel.</p>

            <p:pieChart id="sample" value="#{chartBean.pieModel}" legendPosition="w"
                        title="Sample Pie Chart" style="width:400px;height:300px" />

            <p:pieChart id="custom" value="#{chartBean.pieModel}" legendPosition="e" fill="false" showDataLabels="true"
                        title="Custom Options" style="width:400px;height:300px" sliceMargin="5" diameter="150" />

            <h3>Source</h3>
            <p:tabView>
                <p:tab title="pieChart.xhtml">
                    <pre name="code" class="xml">
&lt;p:pieChart id="sample" value="\#{chartBean.pieModel}" legendPosition="w"
                title="Sample Pie Chart" style="width:400px;height:300px" /&gt;

&lt;p:pieChart id="custom" value="\#{chartBean.pieModel}" legendPosition="e" fill="false" showDataLabels="true"
                title="Custom Options" style="width:400px;height:300px" sliceMargin="5" diameter="150" /&gt;
                    </pre>
                </p:tab>

                <p:tab title="ChartBean.java">
            <pre name="code" class="java">
package org.primefaces.examples.view;

import java.io.Serializable;

import org.primefaces.model.chart.PieChartModel;

public class ChartBean implements Serializable {

    private PieChartModel pieModel;

	public ChartBean() {
        createPieModel();
	}

    public PieChartModel getPieModel() {
        return pieModel;
    }

    private void createPieModel() {
        pieModel = new PieChartModel();

        pieModel.set("Brand 1", 540);
        pieModel.set("Brand 2", 325);
        pieModel.set("Brand 3", 702);
        pieModel.set("Brand 4", 421);
    }
}
            </pre>
                </p:tab>
            </p:tabView>
           

        </div>



    </ui:define>
</ui:composition>
